<?php if (!defined('THINK_PATH')) exit();?><script>
	function check($obj,$k){
		var checked=$obj.checked;
		if(checked){
			$(".check"+$k).attr('checked',true);
		}else{
			$(".check"+$k).attr('checked',false);
		}
		home();
	}

	function checkChild($i){
		var  checkedLength=$('.check'+$i+':checked').length;
		if(checkedLength>0){
			$("#check"+$i).attr('checked',true);
		}else{
			$("#check"+$i).attr('checked',false);
		}
		home();
	}

	function home(){
		var home=$("#home").attr('checked');
		var  homeCheckedLength=$('[name="node_id[]"]:checked').length;
		if(homeCheckedLength>0){
			$("#home").attr('checked',true);
		}else{
			$("#home").attr('checked',false);
		}
	}
</script>
<div class="page">
	<div class="pageContent">
<form method="post" action="/stweb/index.php?s=/Admin/Role/insertAccess" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
	<div  layoutH="30">
	<input type="hidden" name="role_id" value="<?php echo ($_GET['groupId']); ?>">
<?php if(is_array($node)): $i = 0; $__LIST__ = $node;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$node1): $mod = ($i % 2 );++$i;?><h2 class="contentTitle"><?php echo ($node1["title"]); ?> <input type="checkbox" name="node_id[]" value="<?php echo ($node1["id"]); ?>_<?php echo ($node1["level"]); ?>_<?php echo ($node1["pid"]); ?>" <?php if(in_array(($node1["id"]), is_array($selectdNode[1])?$selectdNode[1]:explode(',',$selectdNode[1]))): ?>checked='checked'<?php endif; ?> class="checkboxCtrl" group="node_id[]" id="home" /></h2>
	<div class="pageFormContent lxzdl">
		<?php if(is_array($node1["_child"])): $k = 0; $__LIST__ = $node1["_child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$node2): $mod = ($k % 2 );++$k;?><fieldset>
				<legend><?php echo ($node2["title"]); ?> <input type="checkbox" name="node_id[]" value="<?php echo ($node2["id"]); ?>_<?php echo ($node2["level"]); ?>_<?php echo ($node2["pid"]); ?>" <?php if(in_array(($node2["id"]), is_array($selectdNode[2])?$selectdNode[2]:explode(',',$selectdNode[2]))): ?>checked='checked'<?php endif; ?> onclick="check(this,<?php echo ($k); ?>)" id="check<?php echo ($k); ?>"/></legend>
					<?php if(is_array($node2["_child"])): $i = 0; $__LIST__ = $node2["_child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$node3): $mod = ($i % 2 );++$i;?><label><?php echo ($node3["title"]); ?> <input type="checkbox" name="node_id[]" value="<?php echo ($node3["id"]); ?>_<?php echo ($node3["level"]); ?>_<?php echo ($node3["pid"]); ?>" <?php if(in_array(($node3["id"]), is_array($selectdNode[3])?$selectdNode[3]:explode(',',$selectdNode[3]))): ?>checked='checked'<?php endif; ?> class="check<?php echo ($k); ?>" onclick="checkChild(<?php echo ($k); ?>)"/></label><?php endforeach; endif; else: echo "" ;endif; ?>
			</fieldset><?php endforeach; endif; else: echo "" ;endif; ?>
</div><?php endforeach; endif; else: echo "" ;endif; ?>
</div>
	<div class="panelBar">
	<div class="">
		<label style="float:left"><input type="checkbox" class="checkboxCtrl" group="node_id[]" />全选</label>
		<ul>
			<li><div class="button"><div class="buttonContent"><button type="button" class="checkboxCtrl" group="node_id[]" selectType="invert">反选</button></div></div></li>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
		</ul>
	</div>
	</div>
</form>
	
	</div>
</div>